/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ar.com.educacionit.vehiculos.ventanas;

import java.awt.Component;
import java.awt.Container;
import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author Educacionit
 */
public abstract class InternalAbstract extends JInternalFrame {


    public void limpiarCampo(JTextField t) {
        t.setText("");
    }

    public void habilitar(JButton b) {
        b.setEnabled(true);
    }
    public void deshabilitar(JButton b) {
        b.setEnabled(false);
    }

    public void limpiarTextField(Component[] com) {
        for (Component o:com) {
            if (o instanceof JTextField)
                ((JTextField)o).setText("");
            else if (o instanceof JPanel)
                limpiarTextField(((Container) o).getComponents());
        }

    }
}
